{if isset($errors)}
	<ul>
		{foreach $errors as $error}
			<li>{$error}</li>
		{/foreach}
	</ul>
{/if}
<form action="{$base_url}&action=data_save" method="post">
	<input type="hidden" name="user[id]" id="user[id]" value="{$user->id}" />
	<table>
		{foreach $properties as $property}
			<tr>
				<td>
					<label for="property[{$property->name}]">{$property->title}</label>
				</td>
				<td>
					{if $property->type == 0}
						<input name="user[UserData][{$property->id}]" type="text" class="text{if $property->required == 1} required{/if}" value="{if !$user->property($property->name)}{$property->default_value}{else}{$user->property($property->name)}{/if}" id="property[{$property->name}]" />
					{else if $property->type == 1}
						<input name="user[UserData][{$property->id}]"{if $user->property($property->name) == 1 || $property->default_value} checked="checked"{/if} type="checkbox" value="1"  id="property[{$property->name}]" />
					{else if $property->type == 2}
						<input name="user[UserData][{$property->id}]" type="text" class="int" value="{if !($user->property($property->name))}{$property->default_value}{else}{$user->property($property->name)}{/if}" id="property[{$property->name}]" />
					{else if $property->type == 3}
						<input name="user[UserData][{$property->id}]" type="text" class="date" value="{if !($user->property($property->name))}{$property->default_value}{else}{$user->property($property->name)}{/if}" id="property[{$property->name}]" />
					{else if $property->type == 4}
						<input name="user[UserData][{$property->id}]" type="text" class="url" value="{if !($user->property($property->name))}{$property->default_value}{else}{$user->property($property->name)}{/if}" id="property[{$property->name}]" />
					{else if $property->type == 5}
						<input name="user[UserData][{$property->id}]" type="text" class="email" value="{if !($user->property($property->name))}{$property->default_value}{else}{$user->property($property->name)}{/if}" id="property[{$property->name}]" />
					{/if}
				</td>
			</tr>
		{/foreach}
		<tr>
			<td class="buttons" colspan="2">
				<input type="submit" class="save" value="Сохранить" />
				<input type="submit" class="apply" value="Применить" />
				<input type="submit" class="cancel" value="Отменить" />
			</td>
		</tr>
	</table>
</form>